home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / CUJ9206.ARJ / 1006075A < prev    next >
Text File  |  1992-06-02  |  991b  |  42 lines

  1. #include <time.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <ctype.h>
  5.  
  6. #define    CMD_LEN    133
  7. #define DEP_LEN    40
  8.  
  9. typedef    enum {WHITE, GRAY, BLACK} COLOR;
  10.  
  11. #define FAIL     1
  12. #define SUCCEED 0
  13.  
  14. typedef struct     CMD {
  15.         struct CMD *link;
  16.         char cmdstr[ CMD_LEN ];
  17.         } CMD;
  18.  
  19. typedef    struct    DEP {
  20.         struct DEP *link;
  21.         char depstr[ DEP_LEN ];
  22.         } DEP;
  23.  
  24. typedef    struct    TARGET {
  25.         struct TARGET *link;
  26.         char target[ DEP_LEN ];
  27.         struct CMD *cmdlink;
  28.         struct DEP *deplink;
  29.         enum COLOR color;
  30.         } TARGET;
  31.  
  32. TARGET    *parse_makefile(int argc, char *argv[], char *target);
  33. long    process_dep(TARGET *p, char *starting_dep);
  34. TARGET    *add_target(TARGET **head, char *target);
  35. DEP    *insert_dependency(TARGET *p, char *dependency);
  36. CMD    *insert_cmd(TARGET *p, char *cmd);
  37. char    *skip_ws(char *s);
  38. TARGET    *search_target_list(TARGET *head, char *target);
  39. long    build_target(TARGET *head, TARGET *p, time_t *parent_t);
  40. long    exec_cmd_list(CMD *p);
  41. long    fatal_error(char *s);
  42.